/**
 * @Author: 陈瑞鹏
 * @Date:   2022-11-25 14:06:33
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-12-19 16:50:24
 */

import gameCtr from "../ctrs/gameCtr";

const { ccclass, property } = cc._decorator;

@ccclass

export default class circleEle extends cc.Component {
  @property({ type: cc.Node, tooltip: "四个节点1" })
  pos1: cc.Node = null;

  @property({ type: cc.Node, tooltip: "四个节点2" })
  pos2: cc.Node = null;

  @property({ type: cc.Node, tooltip: "四个节点3" })
  pos3: cc.Node = null;

  @property({ type: cc.Node, tooltip: "四个节点4" })
  pos4: cc.Node = null;
  public normalColor: string = "#00DBFF";

  public moveColor: string = "#ffffff";

  public circleId: number;

  protected onEnable(): void {

  }

  drawColor(str) {
    this.node.color = new cc.Color().fromHEX(str);
  }
  public hp: number = 0;

  public poolName = "circle";

  hurtBlood(poolName) {
    this.hp -= 1;
    if (this.hp <= 0) {
      this.poolName = poolName;
      this.recover();
    }
  }

  recover() {
    gameCtr.ins.poolObj[this.poolName].put(this.node);
  }

  drawGrap() {

  }
}